#pragma once

#include <stdint.h>
#include "Buffer.h"
#include "Protocol.h"

class CCustomProt : public CProtocol
{
public:
    CCustomProt();
    ~CCustomProt();

public:
    static CCustomProt *CustomProtParse(CBuffer<> *pBuffer, PkgBuf *pbRecv, ProtModule &pm);

    int8_t ModuleParse(CBuffer<> *pBuffer, PkgBuf *pbRecv);
    HandleResult DataParse(CBuffer<> *pBuffer, PkgBuf *pbRecv);
    HandleResult DataHandle(PkgBuf *pbRecv, CClient *pClnt);

    bool ProtResponse(PkgBuf *pbSend, bool bResult);
    bool ModuleResponse(PkgBuf *pbSend, bool bResult);

    uint16_t PackageData(uint8_t *pDest, uint8_t *pSrc, uint16_t nLen);
};
